﻿@page "/forgot-password"
@attribute [AllowAnonymous]

<PageTitle>Forgot Password</PageTitle>

<EditForm Model="@_forgotPasswordRequest" OnValidSubmit="SubmitAsync">
    <MudCard Elevation="0">
        <MudCardHeader>
            <CardHeaderContent>
                <MudTooltip Text="Go Back">
                    <MudIconButton Icon="@Icons.Material.Filled.ArrowBack" Color="Color.Inherit" Edge="Edge.Start"
                        Href="/" />
                </MudTooltip>
                <div class="fsh-center-text" style="padding-top: 20px;">
                    <MudText Typo="Typo.h4" GutterBottom="true" style="margin-bottom:5px">Forgot Password?
                    </MudText>
                    <MudText>We can help you by resetting your password.</MudText>
                </div>
            </CardHeaderContent>
        </MudCardHeader>
        <MudCardContent>
            <MudGrid>
                <DataAnnotationsValidator />
                <FshValidation @ref="_customValidation" />
                <MudItem xs="12">
                    <MudTextField T="string" Label="Tenant" Variant="Variant.Outlined" @bind-Value="Tenant"
                        For="@(() => Tenant)" Required />
                </MudItem>
                <MudItem xs="12">
                    <MudTextField T="string" Label="E-mail" Variant="Variant.Outlined"
                        @bind-Value="_forgotPasswordRequest.Email" For="@(() => _forgotPasswordRequest.Email)"
                        InputType="InputType.Email" Adornment="Adornment.End" />
                </MudItem>
            </MudGrid>
        </MudCardContent>
        <MudCardActions Class="pb-4 pl-4">
            <MudButton DropShadow="false" Variant="Variant.Filled" Color="Color.Primary" StartIcon="@Icons.Material.Filled.LockReset" ButtonType="ButtonType.Submit" Disabled="BusySubmitting" Class="ml-auto">
                Forgot Password</MudButton>
        </MudCardActions>
    </MudCard>
</EditForm>